package com.atguigu.gmall.client;

import com.atguigu.gmall.client.impl.PaymentFeignClientImpl;
import com.atguigu.gmall.model.payment.PaymentInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author Fxz
 * @version 1.0
 * @date 2022-02-24 22:04
 */
@SuppressWarnings("all")
@FeignClient(value = "service-payment", fallbackFactory = PaymentFeignClientImpl.class)
public interface PaymentFeignClient {

	/**
	 * 关闭交易
	 */
	@GetMapping("/api/payment/alipay/closePay/{orderId}")
	public Boolean closePay(@PathVariable Long orderId);

	/**
	 * 查看是否存在交易记录
	 */
	@GetMapping("/api/payment/alipay/checkPayment/{orderId}")
	public Boolean checkPayment(@PathVariable Long orderId);

	/**
	 * 查询本地是否有交易记录
	 */
	@GetMapping("/api/payment/alipay/getPaymentInfo/{outTradeNo}")
	public PaymentInfo getPaymentInfo(@PathVariable String outTradeNo);

}
